// 引入工具类
import axios from '../config'

// 使用
const URL = 'api-ftp' // 公共前缀地址
export const ruleTemplate = {
	//定价方法匹配规则模板-查询
	findAll(data) {
		return axios.post(URL + '/ftp/ruleTemplate/findAll', data)
	},
	//查询模板是否使用
	isDelete(data) {
		return axios.post(URL + '/ftp/ruleTemplate/isDelete', data)
	},
	//删除模板
	remove(data) {
		return axios.post(URL + '/ftp/ruleTemplate/remove', data)
	},
	//导出模板
	exp(data) {
		return axios.exportFile(URL + '/ftp/ruleTemplate/exp', data, false)
	},
	//导入模板
	imp(data) {
		return axios.fileUpload(URL + '/ftp/ruleTemplate/imp', data, false)
	},
	//获取元素字段
	findBusinessByType(data) {
		return axios.post(URL + '/ftp/businessEle/findBusinessByType', data)
	},
	//通过模板字段 获取口径
	findCaliberByTemplateFieldId(data) {
		return axios.post(URL + '/ftp/ruleTemplateField/findCaliberByTemplateFieldId', data,false)
	},

	//查找单模板下所有模板字段
	findAllRuleTemplateField(data) {
		return axios.post(URL + '/ftp/ruleTemplateField/findAll', data)
	},
	//删除模板字段
	removeTemplateField(data) {
		return axios.post(URL + '/ftp/ruleTemplateField/remove', data)
	},
	//校验字段值是否唯一
	checkUsing(data,loading=false) {
		return axios.post(URL + '/ftp/ruleTemplate/checkUsing', data,loading)
	},
	//保存模板
	save(data) {
		return axios.post(URL + '/ftp/ruleTemplate/save', data)
	},
	//检查编号是否重复
	checkCode(data,loading=false) {
		return axios.post(URL + '/ftp/methodRuleGroup/checkCode', data,loading)
	},
	//检查名称是否重复
	checkNameUnique(data,loading=false) {
		return axios.post(URL + '/ftp/methodRuleGroup/checkNameUnique', data,loading)
	},
	//根据模板类型查询模板数据
	findTemplataByType(data) {
		return axios.post(URL + '/ftp/ruleTemplate/findTemplataByType', data)
	},
	//查询规则树列表数据
	methodRuleGroupTree(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/methodRuleGroupTree', data)
	},
	//删除校验-规则组是否被情景引用
	methodRuleGroupCheckUsing(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/checkUsing', data)
	},
	//删除规则组
	methodRuleGroupRemove(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/remove', data)
	},
	//保存规则组
	methodRuleGroupSave(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/save', data)
	},
	findAllList_mtdRlGrp(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/findAllList', data)
	},

	//查询列表数据
	methodRuleFindAll(data) {
		return axios.post(URL + '/ftp/methodRule/findAll', data)
	},
	//通过模板ID获取模板字段集合
	findFieldListByTemplateId(data) {
		return axios.post(URL + '/ftp/ruleTemplate/findFieldListByTemplateId', data)
	},
	//获取折线曲线列表
	findCurveDefList(data) {
		return axios.post(URL + '/ftp/curveManage/curveDef/findCurveDefList', data)
	},
	//跳转ToForm
	toForm(data) {
		return axios.post(URL + '/ftp/methodRuleGroup/toForm', data)
	},
	//保存规则
	methodRuleSave(data) {
		return axios.post(URL + '/ftp/methodRule/save', data)
	},
	//通过templateFieldId查询模板字段
	findFiledData(data) {
		return axios.post(URL + '/ftp/ruleTemplateField/findFiledData', data)

	},
	//查询历史
	findHistory(data){
		return axios.post(URL + '/ftp/methodRule/findHistory', data)
	},
	//删除定价方法规则
	methodRuleRemove(data){
		return axios.post(URL + '/ftp/methodRule/remove', data)
	},
	//定价方法规则回显
	methodRuleToForm(data){
		return axios.post(URL + '/ftp/methodRule/toForm', data)
	},
	//导出模板
	expMethodRule(data) {
		return axios.exportFile(URL + '/ftp/methodRule/exp', data, false)
	},
	//导入模板
	impMethodRule(data) {
		return axios.fileUpload(URL + '/ftp/methodRule/imp', data, false)
	},




	//-----------------------------调整项--------------------
	adjDefFindAll(data) {
		return axios.post(URL + '/ftp/adjustDefinition/findAll', data)
	},
	//调整项定义保存
	saveAdjDef(data) {
		return axios.post(URL + '/ftp/adjustDefinition/save', data)
	},
    //调整项定义删除是否引用
	adjDefIsDelete(data) {
		return axios.post(URL + '/ftp/adjustDefinition/isDelete', data)
	},
	//调整项定义删除
	adjDefRemove(data) {
		return axios.post(URL + '/ftp/adjustDefinition/remove', data)
	}

}




